home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / lsof_3.37 / 00DIST next >
Encoding:
Text File  |  1995-08-01  |  36.7 KB  |  1,052 lines

  1.  
  2.         Notes for the distribution of lsof version 3
  3.  
  4. ********************************************************************
  5. | The latest release of lsof is always available via anonymous ftp |
  6. | from vic.cc.purdue.edu.  Look in pub/tools/unix/lsof.            |
  7. ********************************************************************
  8.  
  9.         Contents
  10.  
  11.         Dialects Supported
  12.         How Lsof Works
  13.         Lsof Output
  14.         Limiting, Filtering, and Selecting Lsof Output
  15.         Parsing Lsof Output with Another Program
  16.         Repeat Mode
  17.         Distribution Restrictions
  18.         Warranty
  19.         What's new in Version 3
  20.         Version 3 Release Notes
  21.         3.0,  May 24, 1994
  22.         3.01, May 27, 1994
  23.         3.02, June 2, 1994
  24.         3.03, July 8, 1994
  25.         3.04, July 15, 1994
  26.         3.05, July 26, 1994
  27.         3.06, September 2, 1994
  28.         3.07, September 8, 1994
  29.         3.08, September 23, 1994
  30.         3.09, October 18, 1994
  31.         3.10, October 21, 1994
  32.         3.11, October 28, 1994
  33.         3.12, October 29, 1994
  34.         3.13, November 11, 1994
  35.         3.14, November 16, 1994
  36.         3.15, November 25, 1994
  37.         3.16, December 2, 1994
  38.         3.17, January 25, 1994
  39.         3.18, January 31, 1995
  40.         3.19, February 10, 1995
  41.         3.20, February 23, 1995
  42.         3.21, March 3, 1995
  43.         3.22, March 9, 1995
  44.         3.23, March 24, 1995
  45.         3.24, March 31, 1995
  46.         3.25, April 5, 1995
  47.         3.26, April 20, 1995
  48.         3.27, May 2, 1995
  49.         3.28, May 26, 1995
  50.         3.29, June 2, 1995
  51.         3.30, June 8, 1995
  52.         3.31, June 16, 1995
  53.         3.32, June 23, 1995
  54.         3.33, June 28, 1995
  55.         3.34, June 30, 1995
  56.         3.35, July 9, 1995
  57.         3.36, July 20, 1995
  58.         3.37, July ??? 1995
  59.  
  60.  
  61. Dialects Supported
  62. ==================
  63.  
  64. Lsof (for LiSt Open Files) lists files opened by processes on
  65. selected Unix systems.  It's a major revision of lsof version 2,
  66. and has been tested on:
  67.  
  68.     AIX 3.2.4, 3.2.5, 4.1,    the IBM RISC/System 6000
  69.     4.1.1, and 4.1.2
  70.     DC/OSx 1.1            Pyramid ES, Nile and S series
  71.     EP/IX 2.1.1            the CDC 4680
  72.     FreeBSD 1.1.5.1, 2.0, and    Intel-based systems
  73.     2.0.5
  74.     HP-UX 8.x, 9.x, and 10    HP systems (some combinations)
  75.     IRIX 4.0.5H, 5.2, 5.3,    SGI systems
  76.     and 6.0
  77.     Linux through 1.2.11    Intel-based systems
  78.     NetBSD 1.0 and 1.0A        Intel and SPARC-based systems
  79.     NEXTSTEP 2.1 and 3.[0123]    all NEXTSTEP architectures
  80.     Novell UnixWare 1.1,    Intel-based systems
  81.     1.1.1, and 1.1.2
  82.     OSF/1 1.3, 2.0, 3.0, and    the DEC Alpha
  83.     3.2
  84.     RISC/os 4.52        MIPS R2000-based systems
  85.     SCO OpenDesktop or        Intel-based systems
  86.     OpenServer 1.1, 3.0,
  87.     and 5.0
  88.     Sequent Dynix 3.0.12    the Sequent Symmetry
  89.     Sequent PTX 2.1.[156] and    Sequent systems
  90.     4.0.[23]
  91.     Solaris 2.[1234]        Sun 4 and i86pc systems
  92.     SunOS 4.1.[1234]        Sun 3 and 4
  93.     Ultrix 2.2, 4.2, 4.3,    DEC RISC and VAX
  94.     and 4.4
  95.     V/88 R32V3, R40V4.2, and    Motorola M88K systems
  96.     R40V4.3
  97.  
  98. (The pub/tools/unix/lsof/contrib directory on vic.cc.purdue.edu
  99. contains information on other ports.)
  100.  
  101.  
  102. How Lsof Works
  103. ==============
  104.  
  105. Using available kernel data access methods -- getproc(), getuser(),
  106. kvm_*(), nlist(), pstat(), read(), readx(), /proc -- lsof reads
  107. process table entries, user areas and file pointers to reach the
  108. underlying structures that describe files opened by processes.
  109.  
  110. Lsof interprets most file node structures -- advfsnodes, cnodes,
  111. cdrnodes, devnodes, fifonodes, gnodes, hsnodes, inodes, mfsnodes,
  112. pcnodes, procnodes, rnodes, snodes, specnodes, s5inodes, tmpnodes.
  113. It understands NFS connections.  It recognizes FIFOs, multiplexed
  114. files, Unix and Internet sockets.  It knows about streams.  It
  115. understands /proc file systems for some dialects.  On many dialects
  116. it recognizes execution text and library references.
  117.  
  118.  
  119. Lsof Output
  120. ===========
  121.  
  122. The lsof output describes:
  123.  
  124.     * the process that has opened the file;
  125.  
  126.     * the process group identification number of the process (optional);
  127.  
  128.     * the command the process is executing;
  129.  
  130.     * the owner of the process;
  131.  
  132.     * for all files in use by the process, including the executing
  133.       text file and the shared libraries it is using:
  134.  
  135.       * the file descriptor number of the file, if applicable;
  136.  
  137.       * the file's access mode;
  138.  
  139.       * the file's lock status;
  140.  
  141.       * the file's device numbers;
  142.  
  143.       * the file's inode number;
  144.  
  145.       * the file's size or offset;
  146.  
  147.       * the name of the file system containing the file;
  148.  
  149.       * any available components of the file's path name;
  150.  
  151.       * the names of the file's stream components;
  152.  
  153.       * the file's local and remote network addresses.
  154.  
  155.  
  156. Limiting, Filtering, and Selecting Lsof Output
  157. ==============================================
  158.  
  159. Lsof accepts options to limit, filter, and select its output.
  160. These are the possible criteria:
  161.  
  162.     * Process ID (PID) number -- to list the open files for a given
  163.       process;
  164.  
  165.     * Process Group ID (PGRP) -- to list the open files for all
  166.       the processes of a given process group;
  167.  
  168.     * User ID number or login name -- to list the open files for
  169.       all the processes of a given user;
  170.  
  171.     * Internet address -- to list the open files using a given
  172.       Internet address (host name), protocol, or port (number or
  173.       name); or to list all open Internet files;
  174.  
  175.     * Command name;
  176.  
  177.     * File descriptor name or number;
  178.  
  179.     * list all open NFS files;
  180.  
  181.     * list all open Unix domain socket files;
  182.  
  183.     * list all uses of a specific file;
  184.  
  185.     * list all open files on a file system.
  186.  
  187. Selection options are normally ORed -- i.e., an open file meeting
  188. any of the criteria is listed.  The selection options may be ANDed
  189. so that an open file will be listed only if it meets all the
  190. criteria.
  191.  
  192. In the absence of any selection criteria, lsof lists files open to
  193. all processes.
  194.  
  195.  
  196. Parsing Lsof Output with Another Program
  197. ========================================
  198.  
  199. The lsof -F option directs it to produce "field" output that can
  200. easily be parsed by another program.  The lsof distribution contains
  201. sample awk, perl 4, and perl 5 scripts in its scripts subdirectory
  202. that show how to post-process field output.
  203.  
  204.  
  205. Repeat Mode
  206. ===========
  207.  
  208. Lsof can be directed to produce output, delay for a specified time,
  209. then repeat the output, cycling until stopped by an interrupt or
  210. quit signal.  This mode is useful for monitoring the status of some
  211. file operation -- e.g., an ftp transfer or a tape backup operation.
  212.  
  213. Repeat mode is more efficient when combined with lsof's selection
  214. options, since they limit lsof overhead.
  215.  
  216. It's possible to use lsof's field output options to supply repeat
  217. mode output to another process for its manipulation.  The scripts
  218. subdirectory of the lsof distribution has sample Perl scripts
  219. showing how to consume lsof repeat mode output from a pipe.
  220.  
  221.  
  222. Distribution Restrictions
  223. =========================
  224.  
  225. Lsof may be used and distributed freely, subject to these limitations:
  226.  
  227. 1. Neither the author nor Purdue University is responsible for
  228.    any consequences of the use of this software.
  229.  
  230. 2. The origin of this software must not be misrepresented, either
  231.    by explicit claim or by omission.  Credit to the author and
  232.    Purdue University must appear in documentation and sources.
  233.  
  234. 3. Altered versions must be plainly marked as such, and must not
  235.    be misrepresented as being the original software.
  236.  
  237. 4. This notice may not be removed from or altered in the lsof source
  238.    files.
  239.  
  240.  
  241. Warranty
  242. ========
  243.  
  244. Lsof is provided as-is without any warranty of any kind, either
  245. expressed or implied, including, but not limited to, the implied
  246. warranties of merchantability and fitness for a particular purpose.
  247. The entire risk as to the quality and performance of lsof is with
  248. you.  Should lsof prove defective, you assume the cost of all
  249. necessary servicing, repair, or correction.
  250.  
  251.  
  252. What's new in Version 3
  253. =======================
  254.  
  255. I had three goals in mind for version 3:
  256.  
  257.     1.    Make it faster.
  258.  
  259.     Lsof 3 defers as many lookup operations -- /dev scan, mount
  260.     table scan, /etc/services scan -- until they're needed.
  261.  
  262.     I used prof on lsof and used its information to reduce lsof's
  263.     overhead.
  264.  
  265.     2.  Make it easier to maintain and port to other systems, and
  266.     eliminate complicated nestings of #if/#else/#endif
  267.     pre-processor statements.
  268.  
  269.     3.    Add a few features:
  270.  
  271.     o  ANDing of options;
  272.  
  273.     o  Sorting of output by Process ID;
  274.  
  275.     o  Searching for Unix domain sockets by name -- to a limited
  276.        extent.
  277.  
  278.     o  Process group ID support.  (This was a late addition.)
  279.  
  280. As a result of goal 2, the organization of lsof version 3 differs
  281. greatly from version 2.  The main directory contains totally common
  282. functions, a dialect subdirectory contains subdirectories of code
  283. specific to each Unix dialect that is supported.  There is also a
  284. dialects/common subdirectory that contains code fragments that are
  285. used by more than one, but not all dialects.
  286.  
  287. A top-level Configure script constructs the complete set of sources
  288. for a given dialect and the Makefile at the top-level.  Configure
  289. is self-documenting.
  290.  
  291.  
  292. Version 3 Release Notes
  293. =======================
  294.  
  295. 3.0        May 24, 1994
  296.         This is the first official release of lsof 3.
  297.  
  298. 3.01        May 27, 1994
  299.         Corrected the #ifdef condition for HASPWSTAYOPEN
  300.         under Sequent Dynix 3.0.12.
  301.  
  302.         Fixed bug that prevented the display of current
  303.         working and root directory path names under SunOS
  304.         4.1.x, even when the user area contained pointers
  305.         to them.
  306.  
  307.         Changed the strategy for allocating space to the
  308.         local proc table in EP/IX, NEXTSTEP, Solaris, and
  309.         SunOS.
  310.  
  311.         Closed the distance between reading the Solaris
  312.         proc structure and its companion pid structure in
  313.         an effort to avoid using a stale pid structure
  314.         pointer.  A stale pid structure pointer sometimes
  315.         causes a segmentation violation in kvm_read().
  316.  
  317.         Added code to the SunOS kread() function to filter
  318.         out non-kernel addresses that might lead kvm_read()
  319.         to a segmentation violation.  The Configure script
  320.         was updated to create a header file, kernelbase.h,
  321.         with the necessary kernel memory boundary value;
  322.         and to remove the header file when the -clean option
  323.         is specified.  The Configure script now passes the
  324.         target name to the Mksrc shell script.  It's used
  325.         by sun/Mksrc to determine the source for kernelbase.h.
  326.  
  327. 3.02        June 2, 1994
  328.         Added #if's to of kernelbase.h for Solaris and
  329.         SunOS.  This eliminates a redeclaration complaint
  330.         from old versions of SunOS.
  331.  
  332.         Added code to process_file() in all dialects to
  333.         display "no more information" when f_count in the
  334.         file structure is zero.
  335.  
  336. 3.03        July 8, 1994
  337.         Added support for displaying process group IDs.
  338.         This includes two new options: -j to select PGRP
  339.         display; and -g<list> to specify a list of PGRPs
  340.         whose files are to be displayed.  (-j was chosen
  341.         to match a similar option in some ps(1)'s.)
  342.  
  343.         Philippe-Andre Prindeville <philipp@res.enst.fr>
  344.         suggested this addition.
  345.  
  346. 3.04        July 15, 1994
  347.         Corrected handling of port name component of -i
  348.         option on systems where htons() is required.
  349.  
  350.         Corrected casting of UID arguments -- needed when
  351.         UID is a short and the compiler wants the minimum
  352.         argument size to be larger.
  353.  
  354. 3.05        July 26, 1994
  355.         Added printing of DECnet socket information for
  356.         the Ultrix 4.2 and 4.3 dialects.  John Beacom
  357.         <beacom@wisnud.physics.wisc.edu> kindly provided
  358.         the test system.  A new Configure abbreviation,
  359.         ultrix42dn, must be used to activate the DECnet
  360.         support.
  361.  
  362. 3.06        September 2, 1994
  363.         The major news in this revision are the V/88 R32V3
  364.         and R40V4.2 ports for Motorola M88K systems.  Chance
  365.         Neale <cneale@panix.com> kindly provided test systems
  366.         and Mike Feldman <feldman@charm.urbana.mcd.mot.com>
  367.         provided technical assistance.
  368.  
  369.         Version 3.06 contains other, minor modifications:
  370.  
  371.         *  The Configure script has been isolated from the
  372.            environment, thanks to a report of a CC=xlc
  373.            problem from Johnny Tolliver <jxt@ca04.cad.ornl.gov>.
  374.            Johnny also suggested a better form for the install
  375.            commands in the Makefile's install rule.  This
  376.            change affected all the dialect Mksrc scripts.
  377.  
  378.            A new HP-UX abbreviation (hpuxx25) was added
  379.            for systems that have the /etc/conf/x25 include
  380.            files.  The old HP-UX abbreviation (hpux) no
  381.            longer references /etc/conf or defines HPUX_CCITT.
  382.  
  383.         *  The command "lsof `tty`" now works most places (maybe
  384.            not always for SGI IRIX, but I tried) thanks to a bug
  385.            report from Casper Dik <casper@fwi.uva.nl>.
  386.  
  387.         *  A mode has been added to disable forking when
  388.            debugging.  The V/88 R40V4.2 debugger needed that.
  389.  
  390.         *  Printing of stream NAMEs was standardized (IRIX
  391.            was different) and an attempt was made to avoid
  392.            stream NAMEs like /dev/ttyx4->/dev/ttyx4.
  393.         
  394.         *  A new documentation file, 00FAQ, accompanies the
  395.            distribution.  It contains frequently asked
  396.            questions about lsof, and the best answers I can
  397.            manage to give.
  398.  
  399.         *  I have a new HP-UX test system, courtesy of Dave
  400.            Curry <davy@ecn.purdue.edu> and George Goble
  401.            <ghg@ecn.purdue.edu> of Purdue's Engineering Computer
  402.            Network.  I want to thank J. Nelson Howell
  403.            <nelson@zeus.mgmt.purdue.edu> of Purdue's School of
  404.            Management for his prior support of lsof development
  405.            under HP-UX.
  406.  
  407. 3.07        September 8, 1994
  408.         This revision contains a small security enhancement.
  409.         Tim Ramsey <tar@ksu.ksu.edu> pointed out that lsof's
  410.         setgid or setuid power might allow it's user to
  411.         read an alternate kernel name list or memory file
  412.         via the -c and -k options that the real UID might
  413.         not have authority to read.  In revision 3.07 lsof
  414.         uses access(2) to check the real UID's authority
  415.         to read files named with -c and -k.
  416.  
  417. 3.08        September 23, 1994
  418.         This revision contains support for Novell's UnixWare,
  419.         versions 1.1, 1.1.1, and 1.1.2.  Peter Lord
  420.         <plord@novell.co.uk> made this possible by providing
  421.         a copy of UnixWare and supplying technical advice.
  422.         Binaries and sources for this version will be
  423.         available from Novell sources.  See the Novell
  424.         UnixWare section of the distribution's 00README
  425.         file for details.
  426.  
  427.         This version adds /proc file system support to the
  428.         dialects derived from SYSV R4 (except EP/IX 2.1.1):
  429.         FreeBSD, IRIX 5.2, Solaris, UnixWare, and V/88
  430.         R40V4.2.
  431.  
  432.         This version compiles under IRIX 4.0.5 again,
  433.         correcting a problem introduced at version 3.06 in
  434.         the "lsof `tty`" fix.
  435.  
  436.         HP-UX now skips file systems whose mount type is
  437.         "ignore".  The presence of the -c option is now
  438.         controlled by the HASCOPT definition in machine.h.
  439.         The HASSWAPPORT option is now documented and
  440.         implemented correctly.  Hans Petter Christiansen
  441.         <hpchr@dxcern.cern.ch> suggested these changes.
  442.  
  443. 3.09        October 18, 1994
  444.         This revision recognizes the DEC Alpha OSF/1 V3.0,
  445.         IBM AIX 4.1, and Solaris 2.4 dialects.  It has
  446.         support for the SunOS 4.1.3 PC file system and two
  447.         bug fixes: an IRIX, V/88, and Solaris file argument
  448.         processing bug; and a V/88 include error.
  449.  
  450.         Alex Kreis <akreis@us.oracle.com> made the initial
  451.         request for DEC OSF/1 V3.0 support and provided
  452.         help with testing.  Ron Young <ron@screamer.nevada.edu>
  453.         graciously provided a test host.  James Woodward
  454.         <woodward@zk3.dec.com> provided invaluable clues
  455.         to V3.0 kernel organization.  Others who read the
  456.         alpha-osf-managers mailing list made generous offers
  457.         of test facilities, and I thank them, too.  The
  458.         decosf3 abbreviation was added to the Configure
  459.         script, and the script was modified to request the
  460.         name of the system configuration subdirectory of
  461.         /sys where the configuration-specific header files
  462.         reside for the decosf1, decosf2, and decosf3
  463.         configuration abbreviations.
  464.  
  465.         Mark Peek <mark_peek@taligent.com> provided and
  466.         tested the AIX 4.1 changes.
  467.  
  468.         Casper Dik <casper@fwi.uva.nl> provided and tested
  469.         the Solaris 2.4 changes.
  470.  
  471.         Friedel Loinger <friedel@wise.tau.ac.il> suggested
  472.         the addition of support for the SunOS 4.1.3 PC file
  473.         system ("pcfs").
  474.  
  475.         Andreas Stolcke <stolcke@ICSI.Berkeley.EDU> supplied
  476.         a fix to a file argument processing bug that causes
  477.         lsof to crash when supplied the path of an NFS
  478.         mounted file.  The bug affects lsof versions for
  479.         Motorola V/88 R40V4.2, SGI IRIX 5.2, and Solaris
  480.         2.[123].
  481.  
  482.         Corrected an error in the path to include prdata.h
  483.         in dlsof.h for Motorola V/88 R40V4.2.
  484.  
  485. 3.10        October 21, 1994
  486.         This revision adds support for the cache and PC file
  487.         systems to Solaris.  It fixes these bugs: a problem
  488.         with the display of Motorola V/88 R40V4.2 device
  489.         numbers; and a failure of Readlink() to resolve
  490.         symbolic links completely in all cases.
  491.  
  492.         Some major internal restructuring was necessary to
  493.         be able to display negative inode numbers for SunOS
  494.         PC file system nodes, while displaying them as
  495.         unsigned numbers for Solaris, hence all dialect
  496.         versions were affected.
  497.  
  498. 3.11        October 28, 1994
  499.         This revision adds support for Linux version 1.0.9.
  500.         Tim Korb <jtk@arthur.cs.purdue.edu> kindly provided
  501.         a development system in the Computer Science
  502.         Department at Purdue.  It is likely that the Linux
  503.         revision will have to be adjusted for each installation,
  504.         and it is probable that this revision will not run
  505.         under later versions of Linux.  See the 00FAQ and
  506.         00REAME files for more information on Linux tuning.
  507.  
  508. 3.12        October 29, 1994
  509.         This revision supports Linux version 1.1.47 -- the
  510.         Yggdrasil Plug-and-Play Linux Fall '94 release.
  511.         Both Linux versions now obtain kernel symbol
  512.         addresses from the /zSystem.map file.
  513.  
  514.         November 4, 1994
  515.         Hendrik G. Seliger <hank@Blimp.automat.uni-essen.de>
  516.         reports that lsof compiles and seems to work under
  517.         Linux 1.1.61.  He used the linux1147 Configure
  518.         abbreviation.
  519.         Marty Leisner <leisner@sdsp.mc.xerox.com>
  520.         reports that the linux1147 Configure abbreviation
  521.         produces a working lsof for Linux 1.1.64, too.
  522.  
  523. 3.13        November 11, 1994
  524.         This revision contains Pyramid DC/OSx support, provided
  525.         by Anthony Shortland <Anthony.Shortland@FMR.com>.
  526.  
  527.         Marty Leisner <leisner@sdsp.mc.xerox.com> reported
  528.         a segmentation violation failure in Linux lsof.
  529.         In response I changed its task structure access to
  530.         use /dev/kmem instead of mmap'ing kernel memory.
  531.         This avoids a possible segmentation violation when
  532.         bad pointers are obtained from kernel memory.  I
  533.         also enabled the setting of Linux INET and Unix
  534.         select flags so that the -n and -U options work --
  535.         I forgot to do that when I did the Linux port.
  536.  
  537.         Marty Leisner reports that the lunix1147 Configure
  538.         abbreviation produces a working lsof for Linux
  539.         1.1.64, too.
  540.  
  541.         Francois Pindard <pinard@iro.umontreal.ca> provided
  542.         a correction to the Linux install rule.
  543.  
  544. 3.14        November 16, 1994
  545.         This revision adjusts the Configure script stanzas
  546.         for DEC OSF/1, Motorola V/88, Pyramid DC/OSx, and
  547.         Ultrix.  It also contains additional support for
  548.         DC/OSx and Ultrix.
  549.  
  550.         Bruce Beare <bjb@pyramid.com> and Robert Vernon
  551.         <bob@pyramid.com.au> helped me understand Pyramid
  552.         nomenclature.  Robert Vernon provided DC/OSx support
  553.         for the RxFS file system and added machine series
  554.         auto-detection to the Configure script. Alex Podlecki
  555.         <a.podlecki@att.com> helped test the updated DC/OSx
  556.         distribution.
  557.  
  558.         Chris Timmons <skynyrd@tahoma.cwu.edu> provided
  559.         information on RISC and VAX Ultrix 4.4 that led to
  560.         correct prefixing of nlist() names.  I updated the
  561.         Configure script to detect Ultrix version, machine
  562.         hardware type, and the presence of DECnet support.
  563.  
  564.         I also updated the OSF/1 and V/88 Configure scripts
  565.         to determine configuration parameters automatically.
  566.  
  567. 3.15        November 25, 1994
  568.         Corrected DEC OSF/1 V2.0 support of the ADVFS file
  569.         system.
  570.  
  571.         Bernt Christandl <beb@mpe-garching.mpg.de> and Alex
  572.         Kreis <akreis@us.oracle.com> helped test.  No OSF/1
  573.         V1.x system with ADVFS was available for testing.
  574.  
  575. 3.16        December 2, 1994
  576.         Fixed some device number handling bugs in DEC OSF/1
  577.         V2.0 and V3.0 support.
  578.  
  579. 3.17        January 25, 1994
  580.         lsof now supports SGI IRIX 5.3, thanks to changes
  581.         supplied by Dave Olson <olson@anchor.engr.sgi.com>;
  582.         and SCO OpenDesktop or OpenServer releases 1.1 and
  583.         3.0, thanks to support from Dion Johnson <dionj@sco.com>,
  584.         Bela Lubkin <belal@sco.com>, and Nathan Peterson
  585.         <nathanp@sco.com>.
  586.  
  587.         Dave Olson pointed out an IRIX stream handling bug
  588.         in sgi/dnode.c.  When I investigated it, I found
  589.         that it had implications wider than SGI IRIX.  The
  590.         eventual fix provided the display of inode numbers
  591.         for character devices when the inode number must
  592.         be obtained from /dev.  IRIX, Solaris, and SunOS
  593.         benefit from the fix.
  594.  
  595.         I added version detection to the Configure script,
  596.         so there is now just one Configure abbreviation
  597.         for IRIX versions 4.05, 5.2, and 5.3 -- ``irix''.
  598.         (The Configure abbreviation for the SCO dialect
  599.         ``sco''.)
  600.  
  601.         Ian Darrow <ian@sq.com> pointed out that lsof
  602.         wouldn't Configure or work properly under Solaris
  603.         on an i86pc.  Sorting out the difficulties made
  604.         clear that the HASSWAPPORT definition should be
  605.         removed from every machine.h file and that ntohs()
  606.         should be used in every dsock.c on every port
  607.         supplied to printinaddr().
  608.  
  609.         Andreas Stolcke <stolcke@ICSI.Berkeley.EDU> pointed
  610.         out a method that sometimes allows lsof to report
  611.         on files open to a crashed or unavailable remote
  612.         NFS server.  This led to the addition of code,
  613.         where possible, to estimate the device number of
  614.         mount points that cannot be stat()'d.  The alternate
  615.         device number can come from /etc/mtab or /etc/mnttab,
  616.         or from the dialect's version of them.  On systems
  617.         that use /etc/mtab or /etc/mnttab, it is sometimes
  618.         possible to add the device number manually to the
  619.         mount options field in the form ``dev=xxxx''.  Some
  620.         internal changes in the way lsof handles device
  621.         numbers were necessary to prevent ones whose dev_t
  622.         typedef is a signed short from causing sign extension
  623.         when promoted to integers as function arguments.
  624.  
  625.         David Addison <addy@meiko.co.uk> and Robert Ehrlich
  626.         <Robert.Ehrlich@inria.fr> pointed out that lsof
  627.         errs when reporting device numbers and other node
  628.         information for some special Sun files.  I rewrote
  629.         most of sun/dnode.c to correct the problem; Robert
  630.         rewrote it again; and I rewrote it once more.
  631.         David and Robert helped me test it under Solaris
  632.         2.[34] and SunOs 4.1.[23].
  633.  
  634.         While using code from the Motorola V/88 port for
  635.         the SCO port, I found and fixed some NFS bugs in
  636.         the V/88 port.
  637.  
  638. 3.18        January 31, 1995
  639.         I added the -b and -w options.  The -b option causes
  640.         lsof to avoid the functions lstat(2), readlink(2),
  641.         and stat(2) that might block in the kernel -- e.g.,
  642.         when they reference an inaccessible NFS file system.
  643.         Instead it uses alternate device numbers obtained
  644.         from the mount table, where possible.
  645.  
  646.         The -w option causes lsof to suppress warning
  647.         messages -- e.g., when the -b option has been
  648.         specified.  The suppression of warning messages
  649.         was formerly bundled into the -t option.  The -t
  650.         option now selects -w.
  651.  
  652.         I figured out how to make alternate AIX 3.2.5 device
  653.         numbers from the kernel mount structure.  The new
  654.         -b option therefore works under AIX 3.2.5.
  655.  
  656.         With the help of Chance Neale <cneale@panix.com>
  657.         I fixed bugs in the Motorola V/88 R32V3 NFS support.
  658.  
  659.         I added a solariscc Configure abbreviation for those
  660.         who want to use Sun's C compiler.
  661.  
  662. 3.19        February 10, 1995
  663.         Robert Ehrlich <Robert.Ehrlich@inria.fr> pointed out
  664.         that lsof might be able to gather more complete path
  665.         name information from the kernel's name cache.  Name
  666.         cache access may be inhibited with the new -C option.
  667.         Revision 3.19 implements name cache access for:
  668.  
  669.             DEC OSF/1 [23].0
  670.             Dynix (Purdue 3.0.12)
  671.             EP/IX 2.1.1
  672.             FreeBSD 1.1.5.1
  673.             HP-UX 9.01
  674.             Motorola V/88 R40V4.2
  675.             NEXTSTEP 3.1
  676.             SGI IRIX 5.3
  677.             Solaris 2.[34]
  678.             SunOS 4.1.x
  679.             Ultrix 2.2 and 4.2
  680.  
  681.         Revision 3.19 does NOT implement name cache access for:
  682.                    ===
  683.  
  684.             AIX                 The knlist() function won't
  685.                     return cache addresses --
  686.                     some IBM wisdom to "protect"
  687.                     their customers.
  688.  
  689.             Linux        My only access is to 1.0.9,
  690.                     and it doesn't seem to have
  691.                     a kernel name cache.
  692.  
  693.             Motorola V/88    It doesn't have a unified
  694.                  R32V3    name cache.
  695.  
  696.             Novell UnixWare     I don't have a test system.
  697.  
  698.             Pyramid DC/OSx    I don't have a test system.
  699.  
  700.             SCO OpenDesktop    It doesn't have a unified
  701.             OpenServer    name cache.
  702.  
  703.             SGI IRIX 4.0.5H    I saw no unified name cache 
  704.                     in the header files before
  705.                     my 4.05H system was converted
  706.                     to 5.2.
  707.  
  708.             SGI IRIX 5.2    I don't have a test system.
  709.  
  710.         Another Robert Ehrlich suggestion led to the
  711.         establishment of a device cache file feature.  The
  712.         new -D option gives control of it.  This feature
  713.         speeds lsof dramatically on some dialects after
  714.         lsof has been called once and the cache has been
  715.         built.  (Calling stat(2) on several hundred or
  716.         thousand /dev nodes can take a long time.)  The
  717.         feature can be disabled or modified in the machine.h
  718.         header file and the dialects/*/ddev.c source file
  719.         when lsof is built.
  720.  
  721. 3.20        February 23, 1995
  722.         Upgraded Linux socket handling for versions 1.1.75
  723.         or greater with help from Marty Leisner
  724.         <leisner@sdsp.mc.xerox.com> and Linus Torvalds
  725.         <Linus.Torvalds@cs.Helsinki.FI>.  There is now a
  726.         single Configure script abbreviation for linux.
  727.  
  728.         Updated for Motorola V/88 R40V4.3 with help from
  729.         Mike Feldman feldman@charm.urbana.mcd.mot.com>
  730.         and Chance Neale <cneale@panix.com>.
  731.  
  732.         Updated for SGI IRIX 6.0 with help from Przemek
  733.         Klosowski <przemek@rrdjazz.nist.gov and Dave Olson
  734.         <olson@anchor.engr.sgi.com>.
  735.  
  736.         Corrected access of device cache file that needs
  737.         to be updated so that someone other than the file
  738.         owner can rewrite it.  Deleted the chmod() failure
  739.         warning.
  740.  
  741.         Updated Configure and the Sun Makefile to specify
  742.         absolute paths to the Sun install program.
  743.  
  744. 3.21        March 3, 1995
  745.         Removed BSDI BSD/386 support, because I no longer
  746.         have a test system, and I needed to have separate
  747.         sources for two of the three dialects (FreeBSD,
  748.         and NetBSD) once served by the BSDI BSD/386 sources.
  749.         FreeBSD sources are now in the freebsd subdirectory;
  750.         NetBSD, in netbsd.
  751.  
  752.         With the help of Greg Earle <earle@isolar.Tujunga.CA.US>
  753.         and Paul Kranenburg <pk@cs.few.eur.nl> installed
  754.         new NetBSD support for versions 1.0 and 1.0A.  The
  755.         NetBSD 0.9 support was removed.  The 1.0A support has
  756.         been tested on Intel and SPARC-based systems.
  757.  
  758. 3.22        March 9, 1995
  759.         Fixed a bug in name cache handling that occasionally
  760.         caused lsof to cause a segmentation violation on
  761.         FreeBSD.  Although the bug didn't do that anywhere
  762.         else, recreated the binaries of all dialect versions
  763.         that use the affected code from rnam.frag and rnch.frag.
  764.  
  765. 3.23        March 24, 1995
  766.         Removed forgotten HASSWAPPORT reference from HP-UX
  767.         machine.h and inserted ntohs() calls in the printinaddr()
  768.         calls of dsock.c for HP-UX and NEXTSTEP.
  769.  
  770.         Added support for NEXTSTEP 3.3, courtesy of Allan
  771.         Nathanson <ajn@NeXT.com>
  772.  
  773. 3.24        March 31, 1995
  774.         Changed Configure script to handle DEC OSF/1 V3.2.
  775.         Removed leading zero from DEC OSF/1 and ADVFS
  776.         version values.  Added dialects/osf/dec_a/3.2 header
  777.         file directory, courtesy of Dave Morrison
  778.         <dmorriso@us.oracle.com>, who also tested the 3.24
  779.         DEC/OSF1 V3.2 lsof.
  780.  
  781. 3.25        April 5, 1995
  782.         Ported to RISC/os on a R2030 (R2000-based) system,
  783.         provided by Zdenko Tomasic <zdenko@harvey.cam.rice.edu>.
  784.  
  785.         Tightened security on the device cache file; lsof
  786.         always tries to change its ownerships to the effective
  787.         IDs after creating it.  This was suggested by Stefan
  788.         Kelm <kelm@cert.dfn.de>.
  789.  
  790.         Ported to FreeBSD 2.0, starting with work done by
  791.         Kurt Jaeger <pi@complx.stgt.sub.org> on lsof revision
  792.         3.16.  Ade Barkah <mbarkah@rksys.com> and William
  793.         McVey <wam@cs.purdue.edu> provided test systems.
  794.  
  795. 3.26        April 20, 1995
  796.         Ported to SCO OpenDesktop or OpenServer 5.0 (aka
  797.         Everest and 3.2v5.0.0).  Hugh Dickins <hughd@sco.COM>,
  798.         Bela Lubkin <belal@sco.COM>, Craig B. Olofson
  799.         <craigo@sco.COM>, and Nathan Peterson <nathan@sco.com>,
  800.         provided me an early-release version of 3.2v5.0.0
  801.         and gave technical advice.
  802.  
  803.         Added length checking of the Namech buffer to the
  804.         printinaddr() function.
  805.  
  806. 3.27        May 2, 1995
  807.         Corrected typo in AIX install rule, courtesy of a
  808.         report from John Colgrave <colgrave@hursley.ibm.com>.
  809.  
  810.         At the suggestion of Greg Earle
  811.         <earle@isolar.Tujunga.CA.US> added a function to
  812.         print the name of the unknown protocol (the AF_*
  813.         symbol), when there is no specific processing for
  814.         it in dsock.c.  This change affected most dialects:
  815.         exceptions are DC/OSx, Linux, Motorola V/88, and
  816.         UnixWare.
  817.  
  818. 3.28        May 26, 1995
  819.         Added support for Sequent PTX 2 and PTX 4.  The
  820.         PTX 2.1.6 and PTX 4.0.2 test systems and technical
  821.         advice were provided by Gerrit Huizenga
  822.         <gerrit@sequent.com>, Peter Jordan <petej@sequent.com>,
  823.         Kevin Smallwood <kcs@sequent.com>, and Mike Spitzer
  824.         <mks@sequent.com>. (Thomas A. Endo) <tendo@netcom.com>
  825.         and (David Putz) <PutzDW@PO1.LMB.unisys.com> tested
  826.         under PTX 2.1.5.  Bob Foertsch <foertsch@uiuc.edu>
  827.         tested under PTX 4.  Kevin Smallwood tested under
  828.         2.1.1.  Others who helped include Shane Kenney
  829.         <shane@sequent.com>, Stephan Rossi <rossi@mtu.edu>,
  830.         Douglas R. Smith <drsmith@us.oracle.com>, and Joel
  831.         White <jdwhite@netcom.com>.
  832.  
  833.         Changed the local dev structure's name to l_dev to
  834.         avoid conflicts with the PTX dev structure.  Added
  835.         a common/rdev1.frag -- a variant of rdev.frag.  It's
  836.         used by EP/IX, PTX, RISC/os, and V/88.
  837.  
  838.         Changed printname() to check Namech first and print
  839.         it if it contains something.  This eliminates some
  840.         hacks in the handling of names for streams, but
  841.         generates some duplicate device name look-up code
  842.         in the dnode.c files of some dialects.
  843.  
  844. 3.29        June 2, 1995
  845.         Added clone device support to Motorola V/88 R40V4.3.
  846.  
  847.         Added a generic ``-X'' option for dialect-specific
  848.         use.  Used it in AIX to allow use of readx().  Lsof
  849.         no longer uses readx() by default, because its use
  850.         can cause an AIX 3.2.x and 4.1.x kernel error to
  851.         appear. Kevin Ruderman <rudi@acs.bu.edu> reported
  852.         this bug to me and the possibility that lsof might
  853.         trigger it.
  854.         
  855.         The error, known as the Stale Segment ID bug, hangs
  856.         the kernel in its dir_search() function, thus
  857.         hanging the application process that called it so
  858.         tightly that the application process can neither
  859.         be killed nor stopped.  The bug does not directly
  860.         affect lsof, but may cause the hang when the kernel
  861.         is searching directories for other processes.
  862.         00FAQ and 00README describe the Stale Segment ID
  863.         bug in more detail.  Consult dialects/aix/machine.h
  864.         for options on enabling or disabling readx() by
  865.         default, or permanently enabling or disabling it
  866.         with the HASXOPT and HASXOPT_VALUE definitions.
  867.  
  868.         When not using readx(), AIX lsof may not report
  869.         fully on all text and loader references.  Changes
  870.         to the kernel getuser() function in AIX 4.1.1 appear
  871.         to have eliminated the text file and loader file
  872.         reference information that once led lsof to use
  873.         readx(); of course, without that information, lsof
  874.         can no longer report on the executing text file or
  875.         shared libraries in 4.1.1.
  876.  
  877.         Changed the Configure script to use a single
  878.         abbreviation, aix, for AIX.  Configure now uses
  879.         /usr/bin/oslevel to determine the AIX version; in
  880.         the absence of /usr/bin/oslevel, Configure issues
  881.         a warning and assumes the version is 3.2.0.  Source
  882.         code changes were made to dialects/aix/*.[ch] to
  883.         accommodate the new form of the _AIXV value.
  884.  
  885. 3.30        June 8, 1995
  886.         Added -c to the installation of the man page in
  887.         the Ultrix Makefile's install rule.  Thanks go to
  888.         Jules van Weerden <Jules.vanWeerden@let.ruu.nl>
  889.         for noticing this omission.
  890.  
  891.         Made FreeBSD 2.0 changes: 1) added automatic sensing
  892.         of the FreeBSD 2.0 boot file path, using the
  893.         getbootfile(3) function (suggested by Ade Barkah
  894.         <mbarkah@rksys.com>); 2) changed kvm_getprocs(3)
  895.         function call to use KERN_PROC_ALL symbol from
  896.         <sys/sysctl.h>, thus eliminating incorrect use of
  897.         the <sys/kinfo.h> and <sys/kinfo_proc.h> header
  898.         files; and 3) removed <sys/kinfo.h> and <sys/kinfo_proc.h>
  899.         header files from dialects/freebsd/include/2/sys
  900.         subdirectory of distribution.
  901.  
  902.         Tested under AIX 4.1.2.
  903.  
  904. 3.31        June 16, 1995
  905.         Added the NOUSAGEONERR definition to allow lsof to
  906.         be compiled with the displaying of usage information
  907.         after option error messages disabled.  Lsof is
  908.         distributed without the NOUSAGEONERR definition --
  909.         i.e., usage output is displayed after option error
  910.         messages.
  911.  
  912.         Worked on documentation in the 00* files and the
  913.         man page, adding tables of contents, making usage
  914.         more consistent, trying to insure proper dialect
  915.         titles, and inserting some notes about distribution
  916.         restrictions (few) and warranty (none).
  917.  
  918.         Fixed Motorola V88 R32V3 bug in handling Internet
  919.         files.  This bug was introduced some time ago, but
  920.         I have only recently been able to test under R32V3
  921.         again.
  922.  
  923. 3.32        June 23, 1995
  924.         Added the ability to the Linux nlist() function to
  925.         automatically detect that the kernel binary is COFF
  926.         or ELF form.  Also corrected the UID_ARG cast from
  927.         int to u_int.  These changes were suggested by
  928.         Michael Shields <shields@tembel.org>.  Joseph J.
  929.         Nuspl Jr.  <nuspl@nvwls.cc.purdue.edu> provided a
  930.         test system.
  931.  
  932.         Updated lsof for HP-UX 10.  Richard Allen <ra@rhi.hi.is>
  933.         provided a test system.  The hpux stanza in the
  934.         HP-UX configure script was updated to sense the
  935.         HP-UX version automatically, and to sense the
  936.         availability of CCITT header files in /etc/conf/x25.
  937.  
  938. 3.33        June 28, 1994
  939.         Added options to select "field" output that can be
  940.         parsed by a subsequent program.  (The -f, -F, and
  941.         -0 options form the selection set.)   Provided
  942.         sample awk and Perl scripts for parsing and displaying
  943.         field output.  This feature was suggested by Dan
  944.         Bernstein <djb@silverton.berkeley.edu>.
  945.  
  946.         Tested under PTX 4.0.3.
  947.  
  948. 3.34        June 30, 1995
  949.         Changed display of file offset to decimal in the
  950.         form "0t12345678" if it is less than 100,000,000.
  951.         The offset is displayed in hexadecimal in the form
  952.         "0x12abcdef" if it is larger than 99,999,999.
  953.  
  954.         Changed inode field output from signed to unsigned
  955.         decimal.  Updated the list_fields.{awk,perl} and
  956.         list_NULf.perl5 scripts.
  957.         
  958.         Documented the truncated inode output form (leading
  959.         `*' and 5 digits) for inodes that are too large
  960.         for the output field; thanks go to Leonard Sitongia
  961.         <sitongia@zia.hao.ucar.edu> for pointing out that
  962.         this wasn't documented.
  963.  
  964. 3.35        July 9, 1995
  965.         Added loopback file system support to Solaris with
  966.         advice from Casper Dik <casper@Holland.Sun.COM>.
  967.  
  968.         Removed the NOSAGEONERR compile option in favor of
  969.         producing a shortened usage message when option
  970.         errors are detected.
  971.  
  972.         Marty Leisner <leisner@sdsp.mc.xerox.com> provided
  973.         code to validate the Linux system map file (/System.map
  974.         or /zSystem.map).  If lsof detects that the system
  975.         map file doesn't match the booted kernel, it
  976.         complains and quits.
  977.  
  978.         Updated host name cache to include dot forms -- e.g.,
  979.         when the host name can't be obtained via gethostbydddr().
  980.         This prevents subsequent lookup delays for the same address.
  981.  
  982. 3.36        July 20, 1995
  983.         Updated kernel name cache handling to assume a default
  984.         size for pointer-linked caches (DEC OSF/1, FreeBSD,
  985.         NetBSD, and SGI IRIX 5.3) when the kernel's cache size
  986.         variable has a value of zero.  A warning is issued,
  987.         but lsof proceeds to read and use the name cache.
  988.  
  989.         Folded rdev1.frag into rdev.frag by supporting a
  990.         HASDNAMLEN #define for those dialects whose DIRTYPE
  991.         structure has a d_namlen definition.
  992.  
  993.         Updated Linux distribution to avoid using d_namlen
  994.         from struct dirent if the Linux version is 1.2.10 or
  995.         greater.  This avoidance might work on earlier
  996.         version of Linux, too, but I have no way of telling.
  997.  
  998.         Added support for FreeBSD 2.0.5.  Ade Barkah
  999.         <mbarkah@hemi.com> provided a test system.
  1000.  
  1001.         Added WARNDEVACCESS definition to machine.h control
  1002.         the default issuance of device directory and
  1003.         subdirectory access errors.
  1004.  
  1005.         Changed options:
  1006.             
  1007.           -m (mount warning) option deleted
  1008.           -c (core file) option changed to -m
  1009.           -c option redesignated as command selector
  1010.           -d (device warning) option deleted
  1011.           -d option redesignated as file descriptor selector
  1012.           -O (order) option changed to less-overhead option
  1013.           -r option added to enable repeat mode
  1014.  
  1015.         Added a repeat mode in which lsof will display
  1016.         output, sleep for the number of seconds defined by
  1017.         the repeat-mode option, -r <seconds>, and then
  1018.         display output again, doing this repetitively until
  1019.         it receives an interrupt or quit signal.  This
  1020.         option is much more efficient for monitoring a file
  1021.         than calling lsof repeatedly from a shell script,
  1022.         since it entails only one set of lsof startup
  1023.         operations.
  1024.  
  1025.         The CANDOCHILD compile-time option has been removed.
  1026.         The -O run-time option will do the same thing.
  1027.  
  1028. 3.37        July ??? 1995
  1029.         Fixed incorrect setting of low-overhead flag from -O
  1030.         option.
  1031.  
  1032.         Marty Leisner reports that d_namlen is not needed
  1033.         under Linux 1.2.8.  Changed the #if test that sets
  1034.         HASDNAMLEN accordingly.
  1035.  
  1036.         Made more changes to option processing: combined
  1037.         -f, -F, and -0 into -F (-0 becomes a field identifier
  1038.         value for -F); now allow -F, -g, -r, and -S to have
  1039.         an optional value; made -F? (help) and -F0 (all
  1040.         fields plus NUL terminator) special forms of -F;
  1041.         and added support for --.  These option processing
  1042.         changes are handled with a local getopt() function
  1043.         (named GetOpt() to avoid confustion).
  1044.  
  1045.         Made yet another attempt to create "standard"
  1046.         install and deinstall SunOS/Solaris Makefile rules.
  1047.  
  1048.  
  1049. Vic Abell <abe@cc.purdue.edu>
  1050. Purdue University Computing Center
  1051. July 27, 1995
  1052.